| @@ -10,9 +10,9 @@ | ||
| 10 | 10 | */ |
| 11 | 11 | declare (strict_types=1); |
| 12 | 12 | namespace WindPress\WindPress\Utils; |
| 13 | 13 | |
| 14 | -use WindPressPackages\Symfony\Component\Stopwatch\Stopwatch; | |
| 14 | +use WindPressDeps\Symfony\Component\Stopwatch\Stopwatch; | |
| 15 | 15 | use Throwable; |
| 16 | 16 | /** |
| 17 | 17 | * Debug tools for the plugin. |
| 18 | 18 | * |
| @@ -22,22 +22,22 @@ | ||
| 22 | 22 | { |
| 23 | 23 | /** |
| 24 | 24 | * The stopwatch instance. |
| 25 | 25 | */ |
| 26 | - private static Stopwatch $stopwatch_instance; | |
| 26 | + private static Stopwatch $stopwatch; | |
| 27 | 27 | /** |
| 28 | 28 | * Get the stopwatch instance. |
| 29 | 29 | */ |
| 30 | - public static function stopwatch() : Stopwatch | |
| 30 | + public static function stopwatch(): Stopwatch | |
| 31 | 31 | { |
| 32 | - if (!isset(self::$stopwatch_instance)) { | |
| 33 | - self::$stopwatch_instance = new Stopwatch(\true); | |
| 32 | + if (!isset(self::$stopwatch)) { | |
| 33 | + self::$stopwatch = new Stopwatch(\true); | |
| 34 | 34 | } |
| 35 | - return self::$stopwatch_instance; | |
| 35 | + return self::$stopwatch; | |
| 36 | 36 | } |
| 37 | 37 | public static function shutdown() |
| 38 | 38 | { |
| 39 | - if (isset(self::$stopwatch_instance)) { | |
| 39 | + if (isset(self::$stopwatch)) { | |
| 40 | 40 | // self::shutdown_stopwatch(); |
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | public static function shutdown_stopwatch() |
| @@ -45,14 +45,14 @@ | ||
| 45 | 45 | $stopwatchEvent = self::stopwatch()->getSectionEvents('__root__'); |
| 46 | 46 | if ($stopwatchEvent === []) { |
| 47 | 47 | return; |
| 48 | 48 | } |
| 49 | - $log = '=== ' . \gmdate('Y-m-d H:i:s', \time()) . ' ===' . \PHP_EOL; | |
| 49 | + $log = '=== ' . gmdate('Y-m-d H:i:s', time()) . ' ===' . \PHP_EOL; | |
| 50 | 50 | foreach ($stopwatchEvent as $ev) { |
| 51 | 51 | $log .= (string) $ev . \PHP_EOL; |
| 52 | 52 | } |
| 53 | 53 | $log .= \PHP_EOL; |
| 54 | - $path = \wp_upload_dir()['basedir'] . '/windpress/debug/stopwatch.log'; | |
| 54 | + $path = wp_upload_dir()['basedir'] . '/windpress/debug/stopwatch.log'; | |
| 55 | 55 | try { |
| 56 | 56 | \WindPress\WindPress\Utils\Common::save_file($log, $path, \FILE_APPEND); |
| 57 | 57 | } catch (Throwable $throwable) { |
| 58 | 58 | } |