composer update
This commit is contained in:
@@ -20,8 +20,10 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
* Formats debug file links.
|
||||
*
|
||||
* @author Jérémy Romey <jeremy@free-agent.fr>
|
||||
*
|
||||
* @final since Symfony 4.3
|
||||
*/
|
||||
class FileLinkFormatter implements \Serializable
|
||||
class FileLinkFormatter
|
||||
{
|
||||
private $fileLinkFormat;
|
||||
private $requestStack;
|
||||
@@ -64,17 +66,11 @@ class FileLinkFormatter implements \Serializable
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
public function serialize()
|
||||
public function __sleep(): array
|
||||
{
|
||||
return serialize($this->getFileLinkFormat());
|
||||
}
|
||||
$this->getFileLinkFormat();
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
public function unserialize($serialized)
|
||||
{
|
||||
$this->fileLinkFormat = unserialize($serialized, ['allowed_classes' => false]);
|
||||
return ['fileLinkFormat'];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,21 +87,17 @@ class FileLinkFormatter implements \Serializable
|
||||
|
||||
private function getFileLinkFormat()
|
||||
{
|
||||
if ($this->fileLinkFormat) {
|
||||
return $this->fileLinkFormat;
|
||||
}
|
||||
if ($this->requestStack && $this->baseDir && $this->urlFormat) {
|
||||
$request = $this->requestStack->getMasterRequest();
|
||||
if ($request instanceof Request) {
|
||||
if ($this->urlFormat instanceof \Closure && !$this->urlFormat = ($this->urlFormat)()) {
|
||||
return;
|
||||
}
|
||||
|
||||
return [
|
||||
if ($request instanceof Request && (!$this->urlFormat instanceof \Closure || $this->urlFormat = ($this->urlFormat)())) {
|
||||
$this->fileLinkFormat = [
|
||||
$request->getSchemeAndHttpHost().$request->getBasePath().$this->urlFormat,
|
||||
$this->baseDir.\DIRECTORY_SEPARATOR, '',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return $this->fileLinkFormat;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user