Update to laravel 7

This commit is contained in:
KodeStar
2022-03-10 11:54:29 +00:00
parent 61a5a1a8b0
commit f9a19fce91
7170 changed files with 274189 additions and 283773 deletions

View File

@@ -15,9 +15,9 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* MemoryDataCollector.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @final
*/
class MemoryDataCollector extends DataCollector implements LateDataCollectorInterface
{
@@ -29,7 +29,7 @@ class MemoryDataCollector extends DataCollector implements LateDataCollectorInte
/**
* {@inheritdoc}
*/
public function collect(Request $request, Response $response, \Exception $exception = null)
public function collect(Request $request, Response $response, \Throwable $exception = null)
{
$this->updateMemoryUsage();
}
@@ -53,29 +53,19 @@ class MemoryDataCollector extends DataCollector implements LateDataCollectorInte
$this->updateMemoryUsage();
}
/**
* Gets the memory.
*
* @return int The memory
*/
public function getMemory()
public function getMemory(): int
{
return $this->data['memory'];
}
/**
* Gets the PHP memory limit.
*
* @return int The memory limit
* @return int|float
*/
public function getMemoryLimit()
{
return $this->data['memory_limit'];
}
/**
* Updates the memory usage data.
*/
public function updateMemoryUsage()
{
$this->data['memory'] = memory_get_peak_usage(true);
@@ -84,12 +74,15 @@ class MemoryDataCollector extends DataCollector implements LateDataCollectorInte
/**
* {@inheritdoc}
*/
public function getName()
public function getName(): string
{
return 'memory';
}
private function convertToBytes($memoryLimit)
/**
* @return int|float
*/
private function convertToBytes(string $memoryLimit)
{
if ('-1' === $memoryLimit) {
return -1;
@@ -97,9 +90,9 @@ class MemoryDataCollector extends DataCollector implements LateDataCollectorInte
$memoryLimit = strtolower($memoryLimit);
$max = strtolower(ltrim($memoryLimit, '+'));
if (0 === strpos($max, '0x')) {
if (str_starts_with($max, '0x')) {
$max = \intval($max, 16);
} elseif (0 === strpos($max, '0')) {
} elseif (str_starts_with($max, '0')) {
$max = \intval($max, 8);
} else {
$max = (int) $max;