updated-packages
This commit is contained in:
30
vendor/symfony/http-kernel/Profiler/Profile.php
vendored
30
vendor/symfony/http-kernel/Profiler/Profile.php
vendored
@@ -25,7 +25,7 @@ class Profile
|
||||
/**
|
||||
* @var DataCollectorInterface[]
|
||||
*/
|
||||
private $collectors = array();
|
||||
private $collectors = [];
|
||||
|
||||
private $ip;
|
||||
private $method;
|
||||
@@ -41,7 +41,7 @@ class Profile
|
||||
/**
|
||||
* @var Profile[]
|
||||
*/
|
||||
private $children = array();
|
||||
private $children = [];
|
||||
|
||||
public function __construct(string $token)
|
||||
{
|
||||
@@ -99,7 +99,7 @@ class Profile
|
||||
/**
|
||||
* Returns the IP.
|
||||
*
|
||||
* @return string The IP
|
||||
* @return string|null The IP
|
||||
*/
|
||||
public function getIp()
|
||||
{
|
||||
@@ -119,7 +119,7 @@ class Profile
|
||||
/**
|
||||
* Returns the request method.
|
||||
*
|
||||
* @return string The request method
|
||||
* @return string|null The request method
|
||||
*/
|
||||
public function getMethod()
|
||||
{
|
||||
@@ -134,13 +134,16 @@ class Profile
|
||||
/**
|
||||
* Returns the URL.
|
||||
*
|
||||
* @return string The URL
|
||||
* @return string|null The URL
|
||||
*/
|
||||
public function getUrl()
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*/
|
||||
public function setUrl($url)
|
||||
{
|
||||
$this->url = $url;
|
||||
@@ -153,11 +156,7 @@ class Profile
|
||||
*/
|
||||
public function getTime()
|
||||
{
|
||||
if (null === $this->time) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return $this->time;
|
||||
return $this->time ?? 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -177,7 +176,7 @@ class Profile
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
public function getStatusCode()
|
||||
{
|
||||
@@ -201,7 +200,7 @@ class Profile
|
||||
*/
|
||||
public function setChildren(array $children)
|
||||
{
|
||||
$this->children = array();
|
||||
$this->children = [];
|
||||
foreach ($children as $child) {
|
||||
$this->addChild($child);
|
||||
}
|
||||
@@ -262,7 +261,7 @@ class Profile
|
||||
*/
|
||||
public function setCollectors(array $collectors)
|
||||
{
|
||||
$this->collectors = array();
|
||||
$this->collectors = [];
|
||||
foreach ($collectors as $collector) {
|
||||
$this->addCollector($collector);
|
||||
}
|
||||
@@ -288,8 +287,11 @@ class Profile
|
||||
return isset($this->collectors[$name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function __sleep()
|
||||
{
|
||||
return array('token', 'parent', 'children', 'collectors', 'ip', 'method', 'url', 'time', 'statusCode');
|
||||
return ['token', 'parent', 'children', 'collectors', 'ip', 'method', 'url', 'time', 'statusCode'];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user