updated packages
This commit is contained in:
@@ -52,13 +52,13 @@ class FileProfilerStorage implements ProfilerStorageInterface
|
||||
$file = $this->getIndexFilename();
|
||||
|
||||
if (!file_exists($file)) {
|
||||
return array();
|
||||
return [];
|
||||
}
|
||||
|
||||
$file = fopen($file, 'r');
|
||||
fseek($file, 0, SEEK_END);
|
||||
|
||||
$result = array();
|
||||
$result = [];
|
||||
while (\count($result) < $limit && $line = $this->readLineFromFile($file)) {
|
||||
$values = str_getcsv($line);
|
||||
list($csvToken, $csvIp, $csvMethod, $csvUrl, $csvTime, $csvParent, $csvStatusCode) = $values;
|
||||
@@ -76,7 +76,7 @@ class FileProfilerStorage implements ProfilerStorageInterface
|
||||
continue;
|
||||
}
|
||||
|
||||
$result[$csvToken] = array(
|
||||
$result[$csvToken] = [
|
||||
'token' => $csvToken,
|
||||
'ip' => $csvIp,
|
||||
'method' => $csvMethod,
|
||||
@@ -84,7 +84,7 @@ class FileProfilerStorage implements ProfilerStorageInterface
|
||||
'time' => $csvTime,
|
||||
'parent' => $csvParent,
|
||||
'status_code' => $csvStatusCode,
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
fclose($file);
|
||||
@@ -149,7 +149,7 @@ class FileProfilerStorage implements ProfilerStorageInterface
|
||||
}, $profile->getChildren()));
|
||||
|
||||
// Store profile
|
||||
$data = array(
|
||||
$data = [
|
||||
'token' => $profileToken,
|
||||
'parent' => $parentToken,
|
||||
'children' => $childrenToken,
|
||||
@@ -159,7 +159,7 @@ class FileProfilerStorage implements ProfilerStorageInterface
|
||||
'url' => $profile->getUrl(),
|
||||
'time' => $profile->getTime(),
|
||||
'status_code' => $profile->getStatusCode(),
|
||||
);
|
||||
];
|
||||
|
||||
if (false === file_put_contents($file, serialize($data))) {
|
||||
return false;
|
||||
@@ -171,7 +171,7 @@ class FileProfilerStorage implements ProfilerStorageInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
fputcsv($file, array(
|
||||
fputcsv($file, [
|
||||
$profile->getToken(),
|
||||
$profile->getIp(),
|
||||
$profile->getMethod(),
|
||||
@@ -179,7 +179,7 @@ class FileProfilerStorage implements ProfilerStorageInterface
|
||||
$profile->getTime(),
|
||||
$profile->getParentToken(),
|
||||
$profile->getStatusCode(),
|
||||
));
|
||||
]);
|
||||
fclose($file);
|
||||
}
|
||||
|
||||
|
||||
10
vendor/symfony/http-kernel/Profiler/Profile.php
vendored
10
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)
|
||||
{
|
||||
@@ -201,7 +201,7 @@ class Profile
|
||||
*/
|
||||
public function setChildren(array $children)
|
||||
{
|
||||
$this->children = array();
|
||||
$this->children = [];
|
||||
foreach ($children as $child) {
|
||||
$this->addChild($child);
|
||||
}
|
||||
@@ -262,7 +262,7 @@ class Profile
|
||||
*/
|
||||
public function setCollectors(array $collectors)
|
||||
{
|
||||
$this->collectors = array();
|
||||
$this->collectors = [];
|
||||
foreach ($collectors as $collector) {
|
||||
$this->addCollector($collector);
|
||||
}
|
||||
@@ -290,6 +290,6 @@ class Profile
|
||||
|
||||
public function __sleep()
|
||||
{
|
||||
return array('token', 'parent', 'children', 'collectors', 'ip', 'method', 'url', 'time', 'statusCode');
|
||||
return ['token', 'parent', 'children', 'collectors', 'ip', 'method', 'url', 'time', 'statusCode'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ class Profiler implements ResetInterface
|
||||
/**
|
||||
* @var DataCollectorInterface[]
|
||||
*/
|
||||
private $collectors = array();
|
||||
private $collectors = [];
|
||||
|
||||
private $logger;
|
||||
private $initiallyEnabled = true;
|
||||
@@ -101,7 +101,7 @@ class Profiler implements ResetInterface
|
||||
}
|
||||
|
||||
if (!($ret = $this->storage->write($profile)) && null !== $this->logger) {
|
||||
$this->logger->warning('Unable to store the profiler information.', array('configured_storage' => \get_class($this->storage)));
|
||||
$this->logger->warning('Unable to store the profiler information.', ['configured_storage' => \get_class($this->storage)]);
|
||||
}
|
||||
|
||||
return $ret;
|
||||
@@ -196,9 +196,9 @@ class Profiler implements ResetInterface
|
||||
*
|
||||
* @param DataCollectorInterface[] $collectors An array of collectors
|
||||
*/
|
||||
public function set(array $collectors = array())
|
||||
public function set(array $collectors = [])
|
||||
{
|
||||
$this->collectors = array();
|
||||
$this->collectors = [];
|
||||
foreach ($collectors as $collector) {
|
||||
$this->add($collector);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user