mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-17 11:13:27 +02:00
Update Twig to v2.15.4
This commit is contained in:
@@ -14,14 +14,14 @@ namespace Twig\Profiler;
|
||||
/**
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @final
|
||||
* @final since Twig 2.4.0
|
||||
*/
|
||||
class Profile implements \IteratorAggregate, \Serializable
|
||||
{
|
||||
const ROOT = 'ROOT';
|
||||
const BLOCK = 'block';
|
||||
const TEMPLATE = 'template';
|
||||
const MACRO = 'macro';
|
||||
public const ROOT = 'ROOT';
|
||||
public const BLOCK = 'block';
|
||||
public const TEMPLATE = 'template';
|
||||
public const MACRO = 'macro';
|
||||
|
||||
private $template;
|
||||
private $name;
|
||||
@@ -30,8 +30,12 @@ class Profile implements \IteratorAggregate, \Serializable
|
||||
private $ends = [];
|
||||
private $profiles = [];
|
||||
|
||||
public function __construct($template = 'main', $type = self::ROOT, $name = 'main')
|
||||
public function __construct(string $template = 'main', string $type = self::ROOT, string $name = 'main')
|
||||
{
|
||||
if (__CLASS__ !== static::class) {
|
||||
@trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', \E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
$this->template = $template;
|
||||
$this->type = $type;
|
||||
$this->name = 0 === strpos($name, '__internal_') ? 'INTERNAL' : $name;
|
||||
@@ -153,17 +157,18 @@ class Profile implements \IteratorAggregate, \Serializable
|
||||
$this->enter();
|
||||
}
|
||||
|
||||
public function getIterator()
|
||||
#[\ReturnTypeWillChange]
|
||||
public function getIterator(): \Traversable
|
||||
{
|
||||
return new \ArrayIterator($this->profiles);
|
||||
}
|
||||
|
||||
public function serialize()
|
||||
public function serialize(): string
|
||||
{
|
||||
return serialize($this->__serialize());
|
||||
}
|
||||
|
||||
public function unserialize($data)
|
||||
public function unserialize($data): void
|
||||
{
|
||||
$this->__unserialize(unserialize($data));
|
||||
}
|
||||
@@ -171,7 +176,7 @@ class Profile implements \IteratorAggregate, \Serializable
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
public function __serialize()
|
||||
public function __serialize(): array
|
||||
{
|
||||
return [$this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles];
|
||||
}
|
||||
@@ -179,7 +184,7 @@ class Profile implements \IteratorAggregate, \Serializable
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
public function __unserialize(array $data)
|
||||
public function __unserialize(array $data): void
|
||||
{
|
||||
list($this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles) = $data;
|
||||
}
|
||||
|
Reference in New Issue
Block a user