mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +02:00
N°8834 - Add compatibility with PHP 8.4 (#819)
* N°8834 - Add compatibility with PHP 8.4 * Rollback of scssphp/scssphp version upgrade due to compilation error
This commit is contained in:
@@ -39,10 +39,8 @@ class StopwatchEvent
|
||||
* @param string|null $category The event category or null to use the default
|
||||
* @param bool $morePrecision If true, time is stored as float to keep the original microsecond precision
|
||||
* @param string|null $name The event name or null to define the name as default
|
||||
*
|
||||
* @throws \InvalidArgumentException When the raw time is not valid
|
||||
*/
|
||||
public function __construct(float $origin, string $category = null, bool $morePrecision = false, string $name = null)
|
||||
public function __construct(float $origin, ?string $category = null, bool $morePrecision = false, ?string $name = null)
|
||||
{
|
||||
$this->origin = $this->formatTime($origin);
|
||||
$this->category = \is_string($category) ? $category : 'default';
|
||||
@@ -207,8 +205,6 @@ class StopwatchEvent
|
||||
|
||||
/**
|
||||
* Formats a time.
|
||||
*
|
||||
* @throws \InvalidArgumentException When the raw time is not valid
|
||||
*/
|
||||
private function formatTime(float $time): float
|
||||
{
|
||||
@@ -225,6 +221,6 @@ class StopwatchEvent
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return sprintf('%s/%s: %.2F MiB - %d ms', $this->getCategory(), $this->getName(), $this->getMemory() / 1024 / 1024, $this->getDuration());
|
||||
return \sprintf('%s/%s: %.2F MiB - %d ms', $this->getCategory(), $this->getName(), $this->getMemory() / 1024 / 1024, $this->getDuration());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user