mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-04 16:08:44 +02:00
migration symfony 5 4 (#300)
* symfony 5.4 (diff dev) * symfony 5.4 (working) * symfony 5.4 (update autoload) * symfony 5.4 (remove swiftmailer mailer implementation) * symfony 5.4 (php doc and split Global accessor class) ### Impacted packages: composer require php:">=7.2.5 <8.0.0" symfony/console:5.4.* symfony/dotenv:5.4.* symfony/framework-bundle:5.4.* symfony/twig-bundle:5.4.* symfony/yaml:5.4.* --update-with-dependencies composer require symfony/stopwatch:5.4.* symfony/web-profiler-bundle:5.4.* --dev --update-with-dependencies
This commit is contained in:
@@ -22,9 +22,9 @@ use Twig\Profiler\Dumper\HtmlDumper;
|
||||
use Twig\Profiler\Profile;
|
||||
|
||||
/**
|
||||
* TwigDataCollector.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class TwigDataCollector extends DataCollector implements LateDataCollectorInterface
|
||||
{
|
||||
@@ -41,7 +41,7 @@ class TwigDataCollector extends DataCollector implements LateDataCollectorInterf
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function collect(Request $request, Response $response, \Exception $exception = null)
|
||||
public function collect(Request $request, Response $response, \Throwable $exception = null)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -127,10 +127,12 @@ class TwigDataCollector extends DataCollector implements LateDataCollectorInterf
|
||||
'<span style="background-color: #ffd">',
|
||||
'<span style="color: #d44">',
|
||||
'<span style="background-color: #dfd">',
|
||||
'<span style="background-color: #ddf">',
|
||||
], [
|
||||
'<span class="status-warning">',
|
||||
'<span class="status-error">',
|
||||
'<span class="status-success">',
|
||||
'<span class="status-info">',
|
||||
], $dump);
|
||||
|
||||
return new Markup($dump, 'UTF-8');
|
||||
@@ -139,17 +141,13 @@ class TwigDataCollector extends DataCollector implements LateDataCollectorInterf
|
||||
public function getProfile()
|
||||
{
|
||||
if (null === $this->profile) {
|
||||
if (\PHP_VERSION_ID >= 70000) {
|
||||
$this->profile = unserialize($this->data['profile'], ['allowed_classes' => ['Twig_Profiler_Profile', 'Twig\Profiler\Profile']]);
|
||||
} else {
|
||||
$this->profile = unserialize($this->data['profile']);
|
||||
}
|
||||
$this->profile = unserialize($this->data['profile'], ['allowed_classes' => ['Twig_Profiler_Profile', 'Twig\Profiler\Profile']]);
|
||||
}
|
||||
|
||||
return $this->profile;
|
||||
}
|
||||
|
||||
private function getComputedData($index)
|
||||
private function getComputedData(string $index)
|
||||
{
|
||||
if (null === $this->computed) {
|
||||
$this->computed = $this->computeData($this->getProfile());
|
||||
@@ -198,7 +196,7 @@ class TwigDataCollector extends DataCollector implements LateDataCollectorInterf
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getName()
|
||||
public function getName(): string
|
||||
{
|
||||
return 'twig';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user